<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2022/2/19
  Time: 15:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="page_nav">
  <%--大于首页，才显示--%>
  <c:if test="${requestScope.page.pageNo > 1}">
    <a href="${requestScope.page.url}&pageNo=1">首页</a>
    <a href="${requestScope.page.url}&pageNo=${requestScope.page.pageNo-1}">上一页</a>
  </c:if>
  当前页为：【${requestScope.page.pageNo}】
  <%--如果是最后一页 不显示下一页--%>
  <c:if test="${requestScope.page.pageNo <requestScope.page.pageTotal}">
    <a href="${requestScope.page.url}&pageNo=${requestScope.page.pageNo+1}">下一页</a>
    <a href="${requestScope.page.url}&pageNo=${requestScope.page.pageTotalCount}">末页</a>
  </c:if>
  <span>共${requestScope.page.pageTotal}页，${requestScope.page.pageTotalCount}条记录</span>
  到第<input value="${param.pageNo}" name="pn" id="pn_input"/>页
  <input type="button" value="确定" id="searchPage">
</div>
<script type="text/javascript">
  $(function (){
    $("#searchPage").click(function (){
      var pageNo = $("#pn_input").val();
      //javaScript中提供了一个location地址栏对象
      //它是一个属性叫href 它可以获取浏览器对账了中的地址
      //href属性可读，可写
      location.href="${pageScope.basePath}${requestScope.page.url}&pageNo="+pageNo;
    })
  })
</script>